import {
  ADD_ADDRESS,
  ADD_CATEGORIES,
  ADD_INFORMATION,
  ADD_RESULT,
  ADD_TOKEN,
  LOGOUT
} from './mutations_type'

export default {
  [ADD_ADDRESS](state, address) {
    state.address = address
  },
  [ADD_CATEGORIES](state, categories) {
    state.categories = categories
  },
  [ADD_INFORMATION](state, information) {
    state.information = information
  },
  [ADD_RESULT](state, user) {
    state.user = user
  },
  [ADD_TOKEN](state, token) {
    state.token = token
  },
  [LOGOUT](state) {
    state.user = {}
    state.token = ''

    localStorage.removeItem('token_id')
  }
}